{extend name='table'}

{block name="button"}


<!--{if auth("addList")}-->
<button data-modal='{:url("addList")}' data-title="{:lang('添加商品表')}" class='layui-btn layui-btn-sm layui-btn-primary'>{:lang('添加商品表')}</button>
<!--{/if}-->


{/block}

{block name="content"}
<div class="layui-tab layui-tab-card">

    <div class="layui-tab-content">
        {include file='table/index_search'}
        <table id="TableList" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
    </div>
</div>
<script>
    $(function () {
        $('#TableList').layTable({
            even: true, height: 'full',
            sort: {field: 'sort desc,id', type: 'desc'},
            where: {type: '{$type|default="index"}'},
            cols: [[
                {field: 'LAY_NUM', title: '{:lang("序号")}', width: 100, align: 'center', },
                {field: 'title', title: '{:lang("表名")}', minWidth: 100, align: 'center', },
                {field: 'username', title: '{:lang("注释")}', minWidth: 100, align: 'center' },
                {field: 'sort', title: '{:lang("排序")}', minWidth: 100, align: 'center' , sort: true, templet: '#SortInputTpl'},
                {field: 'create_at', title: '{:lang("创建时间")}', minWidth: 100, align: 'center' },
                {toolbar: '#toolbar', title: '{:lang("操作面板")}', align: 'center', minWidth: 180, fixed: 'right'}
            ]]
        });

    });
</script>

<!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl">
    <input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
</script>

<script type="text/html" id="toolbar">


    <a class="layui-btn layui-btn-sm layui-btn-normal" data-event-dbclick data-title="{:lang('匹配商品表')}" data-modal='{:url("edit")}?id={{d.id}}'>{:lang('匹配商品表')}</a>
    <!--{if auth("edit")}-->
    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="{:lang('编辑')}" data-modal='{:url("edit")}?id={{d.id}}'>{:lang('编 辑')}</a>
    <!--{/if}-->
    <!--{if auth("remove")}-->
    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="{:lang('确定要永久删除吗？')}" data-action="{:url('remove')}" data-value="id#{{d.id}}">{:lang('删 除')}</a>
    <!--{/if}-->

</script>
{/block}
